package com.itheima.a01interfacedemo1;

public class Test {
    public static void main(String[] args) {
        Animal a = new Rabbit("兔子", 1);
        a.eat();
        a.setName("兔子2");
        a.setAge(2);
        System.out.println(a.getName());
        System.out.println(a.getAge());
        a = new Dog("狗", 1);
        a.eat();
        a.setName("狗2");
        a.setAge(2);
        System.out.println(a.getName());
        System.out.println(a.getAge());
        a = new Frog("青蛙", 1);
        a.eat();
        a.setName("青蛙2");
        a.setAge(2);
        System.out.println(a.getName());
        System.out.println(a.getAge());
        ((Swim)a).swim();

    }
}
